package com.album.web.service;

import com.album.web.api.IAlbumService;
import com.album.web.domain.AlbumBean;
import com.album.web.domain.UserBean;
import com.album.web.mapper.AlbumMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AlbumService implements IAlbumService {

    @Resource
    AlbumMapper albumMapper;

    @Override
    public List<AlbumBean> getAlbumListByUser(UserBean userBean) {
        List<AlbumBean> albumList = albumMapper.getAlbumListByUser(userBean);
        return albumList;
    }

    @Override
    public List<AlbumBean> getAlbumListTotal() {
        return albumMapper.getAlbumListTotal();
    }

    @Override
    public AlbumBean selectAlbum(AlbumBean albumBean) {
        return albumMapper.selectAlbum(albumBean);
    }

    @Override
    public int insertAlbum(AlbumBean albumBean) {
        return albumMapper.insertAlbum(albumBean);

    }

    @Override
    public void uploadAlbum(AlbumBean albumBean) {
        albumMapper.uploadAlbum(albumBean);

    }

    @Override
    public void deleteAlbum(AlbumBean albumBean) {
        albumMapper.deleteAlbum(albumBean);

    }

    @Override
    public List<AlbumBean> getMyAlbumlist(UserBean userBean) {
        List<AlbumBean> albumList = albumMapper.getMyAlbumlist(userBean);
        return albumList;
    }

    /**
     * @Description: 根据时间段找到对应的数据，接收 begin 和 end
     * @Author: Ray
     * @Date: 2020/5/20 0020 9:33
     * @param albumBean:
     * @return: java.util.List<com.album.web.domain.AlbumBean>
     **/
    @Override
    public List<AlbumBean> listByCreateTime(AlbumBean albumBean) {
        return albumMapper.listByCreateTime(albumBean);
    }

}
